package com.ssdp.controller;


import com.ssdp.dto.Result;
import com.ssdp.service.IVoucherOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author syo 2319615164@qq.com
 * @description 优惠券订单接口
 * @date 2024/3/14
 * @Copyright syo
 */
@RestController
@RequestMapping("/voucher-order")
@Api(tags = "优惠券下单相关接口")
@RequiredArgsConstructor
public class VoucherOrderController {

    private final IVoucherOrderService voucherOrderService;

    @ApiOperation("优惠券秒杀")
    @PostMapping("seckill/{id}")
    public Result seckillVoucher(@PathVariable("id") Long voucherId) {
        return voucherOrderService.seckillVoucher(voucherId);
    }
}
